global.BodyData = db.collection("Menstruation.BodyData");
module.exports = {
	get: function(req, res) {
		co(function*() {
			var dataCount = (yield BodyData.count()) || 1;
			var doc = yield BodyData.find({}).skip(dataCount - 1).limit(1).toArray();
			doc = doc[0];
			res.send(doc || {});
		});
	},
	post: function(req, res) {
		var bodyData = req.body;
		bodyData.time = new Date().getTime();
		BodyData.insertOne(bodyData);
		res.send({});
	}
}